from django.db import models
from django.contrib.auth.models import AbstractUser
from utils.upload_file import user_upload_to

# Create your models here.
class SysUser(AbstractUser):
    # avatar = models.CharField(max_length=255, null=True, verbose_name="用户头像")
    avatar = models.ImageField(upload_to=user_upload_to, null=True, blank=True, verbose_name="用户头像")
    phonenumber = models.CharField(max_length=30, null=True, verbose_name="手机号码")
    login_date = models.DateField(null=True, verbose_name="最后登录时间")
    status = models.IntegerField(null=True, verbose_name="帐号状态（0正常 1停用）")
    create_time = models.DateField(auto_now=True, verbose_name="创建时间", )
    update_time = models.DateField(auto_now_add=True, verbose_name="更新时间")
    remark = models.CharField(max_length=500, null=True, verbose_name="备注")

    class Meta:
        db_table = "sys_user"
